package com.woniuxy.provider;

import org.apache.ibatis.jdbc.SQL;

import com.woniuxy.pojo.Guest;

public class GuestProvider {
	
	public String findGuests(Guest guest){
		return new SQL(){
			{
				SELECT("*");
				FROM("guest");
				if(guest.getGname()!=null&&guest.getGname().length()!=0){
					WHERE("gname=#{gname}");
				}
				if(guest.getGidcard()!=null&&guest.getGidcard().length()!=0){
					WHERE("gidcard=#{gidcard}");
				}
			}
		}.toString();
	}

}